package org.gdpu.model;

import org.gdpu.util.ExcelResources;

import javax.persistence.*;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: willson
 * Date: 13-10-31
 * Time: 上午10:59
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class BloodOrder {

    private int applyBloodId;
    private Office officeName;
    private double bloodVolume;
    private UserInfo doctorName;  //申请人
    private Date applyTime;
    private String user; //使用人
    private String message;
    /**
     * 状态。0：未发血 1:已发血；2：血液异常
     */
    private int state;
    private String checkPerson;//审核人
    private BloodType bloodType;
    /**
     * 血液成分
     */
    private BloodName bloodName;

    @Id
    @GeneratedValue
    @ExcelResources(title = "订单号", order = 1)
    public int getApplyBloodId() {
        return applyBloodId;
    }

    public void setApplyBloodId(int applyBloodId) {
        this.applyBloodId = applyBloodId;
    }

    @ManyToOne
    @JoinColumn(name = "officeId")
    @ExcelResources(title = "科室", order = 2)
    public Office getOfficeName() {
        return officeName;
    }

    public void setOfficeName(Office officeName) {
        this.officeName = officeName;
    }

    @ExcelResources(title = "用血量", order = 3)
    public double getBloodVolume() {
        return bloodVolume;
    }

    public void setBloodVolume(double bloodVolume) {
        this.bloodVolume = bloodVolume;
    }

    @ManyToOne
    @JoinColumn(name = "userId")
    @ExcelResources(title = "申请医生", order = 7)
    public UserInfo getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(UserInfo doctorName) {
        this.doctorName = doctorName;
    }

    @ExcelResources(title = "申请时间", order = 4)
    public Date getApplyTime() {
        return applyTime;
    }

    public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }

    @ExcelResources(title = "病人", order = 8)
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @ExcelResources(title = "信息", order = 5)
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @ExcelResources(title = "状态", order = 6)
    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    @ExcelResources(title = "审核人", order = 9)
    public String getCheckPerson() {
        return checkPerson;
    }

    public void setCheckPerson(String checkPerson) {
        this.checkPerson = checkPerson;
    }

    @ManyToOne
    @JoinColumn(name = "bloodTypeId")
    public BloodType getBloodType() {
        return bloodType;
    }

    public void setBloodType(BloodType bloodType) {
        this.bloodType = bloodType;
    }

    @ManyToOne
    @JoinColumn(name = "bloodName")
    public BloodName getBloodName() {
        return bloodName;
    }

    public void setBloodName(BloodName bloodName) {
        this.bloodName = bloodName;
    }
}
